<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Homework Hub: Dbz.HomeworkHub.Frontend/Controllers/TopicController.cs Quellcode</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Homework Hub
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Erzeugt von Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Suchen');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Hauptseite</span></a></li>
      <li><a href="namespaces.html"><span>Pakete</span></a></li>
      <li><a href="annotated.html"><span>Klassen</span></a></li>
      <li class="current"><a href="files.html"><span>Dateien</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Suchen" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Auflistung&#160;der&#160;Dateien</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Alle</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Klassen</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namensbereiche</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Funktionen</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Propertys</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_8ceaaad29b11b58613139a8a4ef8dad7.html">Dbz.HomeworkHub.Frontend</a></li><li class="navelem"><a class="el" href="dir_57ad1030c8a5a5cf49df6104f4e5fc29.html">Controllers</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">TopicController.cs</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="keyword">using</span> System;</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="keyword">using</span> System.Collections.Generic;</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="keyword">using</span> System.Linq;</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="keyword">using</span> System.Web;</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="keyword">using</span> System.Web.Mvc;</div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="keyword">namespace </span>Dbz.HomeworkHub.Frontend.Controllers</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;{</div>
<div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html">   12</a></span>&#160;    <span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html">TopicController</a> : <a class="code" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_base_controller.html">BaseController</a></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;    {</div>
<div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a59357c959ca6dbac7f759781f53730c5">   18</a></span>&#160;        <span class="keyword">public</span> ActionResult <a class="code" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a59357c959ca6dbac7f759781f53730c5">Index</a>()</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;        {</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;            <span class="keywordflow">return</span> View(<span class="keyword">new</span> Models.TopicModel());</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        }</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a0c5326e8892b078d0d0300b80b397e0d">   27</a></span>&#160;        <span class="keyword">public</span> JsonResult <a class="code" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a0c5326e8892b078d0d0300b80b397e0d">ListTopics</a>()</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;        {</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;            List&lt;<a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_entities_1_1_topic.html">Dbz.HomeworkHub.Core.Entities.Topic</a>&gt; themen = BusinessObjects.Topics.GetAll();</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;            JsonResult jr = <span class="keyword">new</span> JsonResult();</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;            jr.Data = themen;</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;            jr.JsonRequestBehavior = JsonRequestBehavior.AllowGet;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;            <span class="keywordflow">return</span> jr;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;        }</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a6634f1d45e080f0acc33a91c9d70e3ab">   42</a></span>&#160;        <span class="keyword">public</span> JsonResult <a class="code" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a6634f1d45e080f0acc33a91c9d70e3ab">New</a>(Dbz.HomeworkHub.Core.Entities.Topic topic)</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        {</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;            <a class="code" href="class_dbz_1_1_homework_hub_1_1_core_1_1_entities_1_1_topic.html">Dbz.HomeworkHub.Core.Entities.Topic</a> newTopic = BusinessObjects.Topics.New(topic.Name);</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;            newTopic.Description = topic.Description;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;            BusinessObjects.Topics.Update(newTopic);</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;            <span class="keywordflow">return</span> ListTopics();</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        }</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a21fae0d5fbb8c0e7c085b87d25185765">   56</a></span>&#160;        <span class="keyword">public</span> JsonResult <a class="code" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a21fae0d5fbb8c0e7c085b87d25185765">Update</a>(Dbz.HomeworkHub.Core.Entities.Topic topic)</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;        {</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;            <span class="keywordflow">if</span> (topic.TopicId &gt; 0)</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;                BusinessObjects.Topics.Update(topic);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;            <span class="keywordflow">return</span> ListTopics();</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        }</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a689d7a5f94528b175ea2539219afade9">   69</a></span>&#160;        <span class="keyword">public</span> JsonResult <a class="code" href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a689d7a5f94528b175ea2539219afade9">Delete</a>(Dbz.HomeworkHub.Core.Entities.Topic topic)</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        {</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            <span class="keywordflow">if</span> (topic.TopicId &gt; 0)</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                BusinessObjects.Topics.Delete(topic);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            <span class="keywordflow">return</span> ListTopics();</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        }</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    }</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;}</div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller_html_a21fae0d5fbb8c0e7c085b87d25185765"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a21fae0d5fbb8c0e7c085b87d25185765">Dbz.HomeworkHub.Frontend.Controllers.TopicController.Update</a></div><div class="ttdeci">JsonResult Update(Dbz.HomeworkHub.Core.Entities.Topic topic)</div><div class="ttdoc">Speichert ein bestehendes Themengebit </div><div class="ttdef"><b>Definition:</b> <a href="_topic_controller_8cs_source.html#l00056">TopicController.cs:56</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller_html_a59357c959ca6dbac7f759781f53730c5"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a59357c959ca6dbac7f759781f53730c5">Dbz.HomeworkHub.Frontend.Controllers.TopicController.Index</a></div><div class="ttdeci">ActionResult Index()</div><div class="ttdoc">Liefert die Standardansicht der Verwaltung von Themengebiete </div><div class="ttdef"><b>Definition:</b> <a href="_topic_controller_8cs_source.html#l00018">TopicController.cs:18</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller_html_a0c5326e8892b078d0d0300b80b397e0d"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a0c5326e8892b078d0d0300b80b397e0d">Dbz.HomeworkHub.Frontend.Controllers.TopicController.ListTopics</a></div><div class="ttdeci">JsonResult ListTopics()</div><div class="ttdoc">Liefert eine Liste aller Themengebiete im JSON Format </div><div class="ttdef"><b>Definition:</b> <a href="_topic_controller_8cs_source.html#l00027">TopicController.cs:27</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller_html_a689d7a5f94528b175ea2539219afade9"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a689d7a5f94528b175ea2539219afade9">Dbz.HomeworkHub.Frontend.Controllers.TopicController.Delete</a></div><div class="ttdeci">JsonResult Delete(Dbz.HomeworkHub.Core.Entities.Topic topic)</div><div class="ttdoc">Löscht ein bestehendes Themengebiet </div><div class="ttdef"><b>Definition:</b> <a href="_topic_controller_8cs_source.html#l00069">TopicController.cs:69</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller_html_a6634f1d45e080f0acc33a91c9d70e3ab"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html#a6634f1d45e080f0acc33a91c9d70e3ab">Dbz.HomeworkHub.Frontend.Controllers.TopicController.New</a></div><div class="ttdeci">JsonResult New(Dbz.HomeworkHub.Core.Entities.Topic topic)</div><div class="ttdoc">Erstellt ein neues Themengebiet </div><div class="ttdef"><b>Definition:</b> <a href="_topic_controller_8cs_source.html#l00042">TopicController.cs:42</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_core_1_1_entities_1_1_topic_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_core_1_1_entities_1_1_topic.html">Dbz.HomeworkHub.Core.Entities.Topic</a></div><div class="ttdoc">DAO-Klasse für Themengebiete </div><div class="ttdef"><b>Definition:</b> <a href="_topic_8cs_source.html#l00011">Topic.cs:11</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_topic_controller.html">Dbz.HomeworkHub.Frontend.Controllers.TopicController</a></div><div class="ttdoc">Kontroller für die Verwaltung von Themengebieten </div><div class="ttdef"><b>Definition:</b> <a href="_topic_controller_8cs_source.html#l00012">TopicController.cs:12</a></div></div>
<div class="ttc" id="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_base_controller_html"><div class="ttname"><a href="class_dbz_1_1_homework_hub_1_1_frontend_1_1_controllers_1_1_base_controller.html">Dbz.HomeworkHub.Frontend.Controllers.BaseController</a></div><div class="ttdoc">Basiscontroller für alle anderen Controller, stellt für abgeleitete Controller den Zugriff auf die Da...</div><div class="ttdef"><b>Definition:</b> <a href="_base_controller_8cs_source.html#l00015">BaseController.cs:15</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Erzeugt am Don Dez 12 2013 10:15:57 für Homework Hub von &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
